# Maintainer: Florian Pritz <bluewind@xinu.at>
# Contributor: João Vitor S. Anjos <jvanjos at protonmail dot com>
# Contributor: Corrado Primier <bardo@aur.archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=stress
pkgver=1.0.6
pkgrel=1
pkgdesc="A tool that stress tests your system (CPU, memory, I/O, disks)"
arch=('loong64' 'x86_64')
url="https://github.com/resurrecting-open-source-projects/stress"
license=('GPL')
options=('!emptydirs')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz")
sha512sums=('6c5be507eb1c874943d57fc07ce98654700b4652b39f71679ba07f5ea2f09e246086176b92478deffdd754d96711b14c956937f75bc0bf7a77752ed5ed3f3093')
validpgpkeys=(BB1838728F40B7E63BFCD67AE52707E90485EFCD)

build() {
  cd "${pkgname}-${pkgver}"
  ./autogen.sh
  ./configure --prefix=/usr --mandir=/usr/share/man
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm644 README.md ChangeLog AUTHORS -t "${pkgdir}/usr/share/doc/${pkgname}"
}
